<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        // let a={
        //     name:'lfp',
        //     age:20,
        //     address:"gansusheng",
        //     func:function()
        //     {
        //         console.log("hello")
        //     }
        // }

        // console.log(a.name)
        // a.func()

        // let b=new Object()
        // b.name="lfp";
        // b.age=20;
        // b.address="gansusheng"
        // b['weight']=10
        // b.func=function()
        // {
        //     console.log("say hello")
        // }

        // console.log(b.name)
        // console.log(b.age)
        // b.func()

        // function Obj(name,age,height)
        // {
        //     this.name=name
        //     this.age=age
        //     this.height=height
        //     this.func=function()
        //     {
        //         console.log(name+"hello")
        //     }
        // }

        // let xiaoming=new Obj("小明",20,75)
        // let lisi=new Obj("李四",20,56)
        // console.log(xiaoming)
        // xiaoming.func()

        // console.log(lisi)
        // lisi.func()

        class Obj{
            constructor(name,age)
            {
                this.name=name
                this.age=age
            }
            func()
            {
                console.log(this.name+"正在说Hello")
            }
            static other="other"
            static sum()
            {
                return 100
            }
        }

        let xiaoming=new Obj("小明",12,20)
        console.log(xiaoming)
        xiaoming.func()

        alert(Obj.other)
        alert(Obj.sum())

    </script>
</body>
</html>